<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>业务详细</title>

<script type="text/javascript">
var coordinateID = 'coordinate';

$(function() {
	bindCoordinateForm(applyid);
	bindShipForm(applyid);
})

function bindCoordinateForm(applyid){
	
	$.ajax({ 
		url: basePath() + 'business/getcoordinateinfo.do',
		data: {"applyid": applyid},
		dataType: "json",
        contentType: "application/json",
		success: function(data){
	    	if(data.result == 1){
	    		for(var i=0; i< data.datas.length; i++){
	    			bindCoordinateInfoList(data.datas[i]);
	    		}
	    	}
      	}
	});
}


function bindCoordinateInfoList(data){
	var serialnumber = data.serialnumber;
	var latarea = data.latarea;
	var latdegree = data.latdegree;
	var latmin = data.latmin;
	var latsecond = data.latsecond;
	var lonarea = data.lonarea;
	var londegree = data.londegree;
	var lonmin = data.lonmin;
	var lonsecond = data.lonsecond;
	
	var htmlStr = ''+		
				'  <tbody class="coordinateForm">'+
				'  <tr>'+
				'    <td rowspan="2" style="vertical-align: middle;">'+
				'		'+ serialnumber +''+
				'	 </td>'+
				'    <td>   '+
				'	      <div class="form-group">'+
				'		    <label class="col-sm-4 control-label">经度</label>'+
				'		    <div class="col-sm-8">'+
				'				'+ latarea +''+
				'		    </div>'+
				'		  </div> '+
				'    </td>'+
				'    <td>'+ latdegree +'</td>'+
				'    <td>'+ latmin +'</td>'+
				'    <td>'+ latsecond +'</td>'+
				'  </tr>'+
				'  <tr>'+
				'    <td>'+
				'	      <div class="form-group">'+
				'		    <label class="col-sm-4 control-label">纬度</label>'+
				'		    <div class="col-sm-8">'+
				'				'+ lonarea +''+
				'		    </div>'+
				'		  </div> '+
				'	  </td>'+
				'    <td>'+ londegree +'</td>'+
				'    <td>'+ lonmin +'</td>'+
				'    <td>'+ lonsecond +'</td>'+
				'  </tr>'+
				'  </tbody>';
	
	$('#' + coordinateID).append(htmlStr);
}

function bindShipForm(applyid){
	$.ajax({ 
		url: basePath() + 'business/getshipinfo.do',
		data: {"applyid": applyid},
		dataType: "json",
        contentType: "application/json",
		success: function(data){
			if(data.result == 1){
	    		var shipidnums = [];
	    		for(var i=0; i< data.datas.length; i++){
	    			bindShipInfoList(data.datas[i]);
		    		shipidnums.push(data.datas[i].shipidnumber);
		    		
	    		}
	    		//绑定校验数据
//	    		bindVerifyForm(applyid,shipidnums);
	    	}
      	}
	});
}


function bindShipInfoList(data){
	var shipidnumber = data.shipidnumber;
	var shipname = data.shipname;
	
	var htmlStr = ''+		
				'<tr>'+
				'	<td>'+ data.shipidnumber +'</td>'+
				'	<td>'+ data.shipname +'</td>'+
				'</tr>';
	
	$('#TableShip').append(htmlStr);
}
</script>
</head>
<body style="background-color: white;">
	<!-- 业务信息 -->
	<table class="table table-bordered">
	<tbody>
		<tr>
			<td class="tdTitle">
				 作业名称：
			</td>
			<td colspan="5">
				<span id="workname"></span>
			</td>
		</tr>
		<!-- <tr>
			<td class="tdTitle">
				作业类型：
			</td>
			<td class="tdContent">
				<span id="worktypename"></span>
			</td>
			<td class="tdTitle">
				作业方式：
			</td>
			<td class="tdContent" colspan="3">
				<span id="workmethodname"></span>
			</td>
		</tr> -->
		<tr>
			<td class="tdTitle">
				作业位置：
			</td>
			<td class="tdContent" colspan="5">
				<span id="waterwayname"></span>
				<span id="navigationmarkname"></span>
				<span id="workposition"></span>
			</td>
		</tr>
		<tr>
			<td class="tdTitle">
				计划开工日期：
			</td>
			<td class="tdContent">
				<span id="workbegintime"></span>
			</td>
			<td class="tdTitle">
				预计完工日期：
			</td>
			<td class="tdContent">
				<span id="workendtime"></span>
			</td>
			<td class="tdTitle">
				预计完工天数：
			</td>
			<td class="tdContent">
				<span id="days"></span>
			</td>
		</tr>
		<tr>
			<td class="tdTitle">
				建设单位：
			</td>
			<td>
				<span id="buildunitname"></span>
			</td>
			<td class="tdTitle">
				建设单位联系人：
			</td>
			<td>
				<span id="buildcontactperson"></span>
			</td>
			<td class="tdTitle">
				建设单位联系电话：
			</td>
			<td>
				<span id="buildcontactphone"></span>
			</td>
		</tr>
		<tr>
			<td class="tdTitle">
				施工单位：
			</td>
			<td>
				<span id="workunitname"></span>
			</td>
			<td class="tdTitle">
				施工单位联系人：
			</td>
			<td>
				<span id="workcontactperson"></span>
			</td>
			<td class="tdTitle">
				施工单位联系电话：
			</td>
			<td>
				<span id="workcontactphone"></span>
			</td>
		</tr>
		<tr>
			<td class="tdTitle">
				施工作业程序：
			</td>
			<td colspan="5">
				<span id="workstep"></span>
			</td>
		</tr>
		<tr>
			<td class="tdTitle">
				应急措施：
			</td>
			<td colspan="5">
				<span id="emergentstep"></span>
			</td>
		</tr>
			<tr>
			<td class="tdTitle">
				设备名称：
			</td>
			<td colspan="5">
				<span id="devicename"></span>
			</td>
		</tr>
		<tr>
			<td class="tdTitle">
				主要技术参数：
			</td>
			<td colspan="5">
				<span id="technicalparameter"></span>
			</td>
		</tr>
		<tr>
			<td class="tdTitle">
				地点范围：
			</td>
			<td colspan="3">
				<table class="table table-bordered" style="text-align: center;" id="coordinate">
				  <thead>
				    <tr>
						<th style="text-align: center; width:10%;">序号</th>
						<th style="text-align: center; width:30%;">经纬度区分</th>
						<th style="text-align: center; width:15%;">度</th>
						<th style="text-align: center; width:15%;">分</th>
						<th style="text-align: center; width:15%;">秒</th>
				    </tr>
				  </thead>
				</table>
			</td>
			<td colspan="2">
				<span id="workarea"></span>
			</td>
		</tr>
	</tbody>
	</table>
	
    <table class="table table-bordered" id="TableShip" style="text-align: center;">
   	<thead>
	   	<tr>
			<th style="text-align: center; background-color: #eee;">船舶识别号</th>
			<th style="text-align: center; background-color: #eee;">中文船舶名称</th>
	    </tr>
    </thead>
	<tbody>

	</tbody>
	</table>
</body>
</html>